@extends('layouts.admin')

@section('title', '|剧集|管理后台|编辑')

@section('styles')
    <link href="//cdn.bootcss.com/select2/4.0.1/css/select2.min.css" rel="stylesheet">
@endsection


@section('content')
    <div class="row">
        <div class="col-md-offset-3 col-md-6">
            {!! Form::open(['action' => 'ShowController@swapShowUpdate', 'method' => 'post']) !!}


            <div class="form-group">
                {!!  Form::label('episodeIds', '选择ep', [])     !!}
                {!! Form::select('episodeIds[]', $ep_list , null , ['class' => 'form-control','multiple' ,'row'=>'10']) !!}
            </div>
            <div class="form-group">
                {!! Form::label('showId', '选择show', [])     !!}
                {!! Form::select('showId', $show_list , null , ['class' => 'form-control','id'=>'show_id']) !!}
            </div>
            {!!  Form::submit('保存',['class'=>'btn btn-primary btn-raised btn-block']) !!}
            {!!  Form::close() !!}
        </div>



    </div>
    <div class="row">
        <div class="well col-md-5">
            {!! Form::open(['url' => 'createShowWithEpisode', 'method' => 'post']) !!}
            {!! Form::label('showName', 'show名称', ['class' => 'control-label']) !!}
            {!! Form::text('showName',null, ['class' => 'form-control']) !!}
            <hr>
            {!! Form::submit('创建show并关联搜索的episodes', ['class' => 'form-control btn-success']) !!}
            {!! Form::close() !!}
        </div>

        <div class="well col-md-offset-2 col-md-5">
            {!! Form::open(['url' => 'createMovieWithEpisode', 'method' => 'post']) !!}
            {!! Form::label('movieName', 'movie名称', ['class' => 'control-label']) !!}
            {!! Form::text('movieName',null, ['class' => 'form-control']) !!}
            <hr>
            {!! Form::submit('创建movie并关联搜索的episodes', ['class' => 'form-control btn-info']) !!}
            {!! Form::close() !!}
        </div>


        <a href="{{route('show.create')}}" target="_blank">创建show</a>

    </div>

    <ul>
        @foreach($ep_list as $key=>$value)
            <li>
                {{$key}} &nbsp;&nbsp;&nbsp;&nbsp;{{$value}}
            </li>
        @endforeach
    </ul>
    <div class="row">


        <div class="well col-md-5">
            {!! Form::open(['url' => 'createShowWithEpisode', 'method' => 'post']) !!}
            {!! Form::label('showName', 'show名称', ['class' => 'control-label']) !!}
            {!! Form::text('showName',null, ['class' => 'form-control']) !!}
            <hr>
            {!! Form::submit('创建show并关联搜索的episodes', ['class' => 'form-control btn-success']) !!}
            {!! Form::close() !!}
        </div>

        <div class="well col-md-offset-2 col-md-5">
            {!! Form::open(['url' => 'createMovieWithEpisode', 'method' => 'post']) !!}
            {!! Form::label('movieName', 'movie名称', ['class' => 'control-label']) !!}
            {!! Form::text('movieName',null, ['class' => 'form-control']) !!}
            <hr>
            {!! Form::submit('创建movie并关联搜索的episodes', ['class' => 'form-control btn-info']) !!}
            {!! Form::close() !!}
        </div>


        <a href="{{route('show.create')}}" target="_blank">创建show</a>

    </div>

@endsection

@section('scripts')
    <script src="//cdn.bootcss.com/select2/4.0.1/js/select2.full.min.js"></script>
    <script>

        $('#show_id').select2({
            placeholder:'choose a tag',
        });
    </script>

@endsection
